import Vue from "vue";
import VueRouter from "vue-router";
import login from "../views/login.vue";
import footer from "../views/footer.vue";

Vue.use(VueRouter);

const routes = [{
    path: "/",
    name: "login",
    component: login
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/register")
  },
  {
    path: "/footer",
    name: "footer",
    component: footer,
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../views/Home")
      },
      {
        path: "/classify",
        name: "classify",
        component: () => import("../views/classify.vue"),
      },
      {
        path: "/shop",
        name: "shop",
        component: () => import("../views/shop.vue")
      },
      {
        path: "/about",
        name: "About",
        component: () => import("../views/About.vue")
      }
    ]
  },
  {
    path: "/shopdetail",
    name: "shopdetail",
    component: () => import("../views/shopdetail.vue"),
    meta: {
      title: '列表',
      keepAlive: true,
      canKeep:false
    }
  },
  {
    path: "/detail",
    name: "detail",
    component: () => import("../views/detail.vue")
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;